import ReactDOM from "react-dom";
import PropTypes from 'prop-types';
import PureChild from './TestPureChild';

import React, { PureComponent } from 'react';

export default class PurePage extends PureComponent{
  constructor() {
    super();
    this.state = {
      isShow: false,
      name: '1🌧️'
    };
    console.log('constructor');
  }
  changeState = () => {
    this.setState({
      isShow: !this.state.isShow
    })
  };
  render() {
    console.log(this.state.name, 'render 中的name');
    return (
      <div>
        <button onClick={this.changeState}>点击</button>
        <div>{this.state.isShow.toString()}</div>
        <PureChild name={this.state.isShow.toString()}/>
      </div>
    );
  }
}